package com.yoki.loginview;

import android.content.Intent;
import android.graphics.Paint;
import android.net.Uri;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;

public class TellusActivity extends AppCompatActivity {

    TextView Phone;
    TextView Address;
    TextView Web;

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_tellus);
        Phone = findViewById(R.id.phoneText);
        Address = findViewById(R.id.addText);
        Web = findViewById(R.id.WebText);
        Phone.getPaint().setFlags(Paint.UNDERLINE_TEXT_FLAG);
        Phone.setTextColor(getResources().getColor(R.color.NotSoBlue));
        Web.getPaint().setFlags(Paint.UNDERLINE_TEXT_FLAG);
        Web.setTextColor(getResources().getColor(R.color.NotSoBlue));
    }

    public void Tell(View view)
    {
        Intent intent = new Intent(Intent.ACTION_DIAL);
        Uri data = Uri.parse("tel://0574-86891367");
        intent.setData(data);
        startActivity(intent);
    }

    public void send(View view)
    {
        Uri data = Uri.parse("smsto:0574-86891367");
        Intent intent = new Intent(Intent.ACTION_SENDTO,data);
        intent.putExtra("sms_body","this is a sample sms");
        startActivity(intent);
    }

    public void web(View view)
    {
        Uri data = Uri.parse("https://www.nbpt.edu.cn");
        Intent intent = new Intent(Intent.ACTION_VIEW);
        intent.setData(data);
        startActivity(intent);
    }
}
